package org.nkumar.logging;

/**
 * Logging API which is meant to be easy.
 * This api has good support for I18N and message formatting.
 */
public interface EasyLogger
{
    /**
     * Check if a message at ERROR level would actually be logged by this logger.
     * @return <code>true</true> if a message at ERROR level is actually logged
     */
    public boolean isErrorEnabled();

    /**
     * Log a message at ERROR level with passed list of params.<br/>
     * No logging happens if isErrorEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void error(String msg, Object... params);

    /**
     * Log a message at ERROR level with associated Throwable information.<br/>
     * No logging happens if isErrorEnabled() returns <code>false</code>.<br/>
     * Note that the thrown argument is stored separately rather than as part of params.
     * Thus it is processed specially by output Formatters
     * and is not treated as a formatting parameter to the message.
     * @param msg the string message (or a key in the message catalog)
     * @param thrown throwable associated with log message
     */
    public void error(String msg, Throwable thrown);

    /**
     * Check if a message at WARN level would actually be logged by this logger.
     * @return <code>true</true> if a message at WARN level is actually logged
     */
    public boolean isWarnEnabled();

    /**
     * Log a message at WARN level with passed list of params.<br/>
     * No logging happens if isWarnEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void warn(String msg, Object... params);

    /**
     * Log a message at WARN level with associated Throwable information.<br/>
     * No logging happens if isWarnEnabled() returns <code>false</code>.<br/>
     * Note that the thrown argument is stored separately rather than as part of params.
     * Thus it is processed specially by output Formatters
     * and is not treated as a formatting parameter to the message.
     * @param msg the string message (or a key in the message catalog)
     * @param thrown throwable associated with log message
     */
    public void warn(String msg, Throwable thrown);

    /**
     * Check if a message at INFO level would actually be logged by this logger.
     * @return <code>true</true> if a message at INFO level is actually logged
     */
    public boolean isInfoEnabled();

    /**
     * Log a message at INFO level with passed list of params.
     * No logging happens if isInfoEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void info(String msg, Object... params);

    /**
     * Log a message at INFO level with associated Throwable information.<br/>
     * No logging happens if isInfoEnabled() returns <code>false</code>.<br/>
     * Note that the thrown argument is stored separately rather than as part of params.
     * Thus it is processed specially by output Formatters
     * and is not treated as a formatting parameter to the message.
     * @param msg the string message (or a key in the message catalog)
     * @param thrown throwable associated with log message
     */
    public void info(String msg, Throwable thrown);

    /**
     * Check if a message at CONFIG level would actually be logged by this logger.
     * @return <code>true</true> if a message at CONFIG level is actually logged
     */
    public boolean isConfigEnabled();

    /**
     * Log a message at CONFIG level with passed list of params.<br/>
     * No logging happens if isConfigEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void config(String msg, Object... params);

    /**
     * Check if a message at DEBUG level would actually be logged by this logger.
     * @return <code>true</true> if a message at DEBUG level is actually logged
     */
    public boolean isDebugEnabled();

    /**
     * Log a message at DEBUG level with passed list of params.<br/>
     * No logging happens if isDebugEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void debug(String msg, Object... params);

    /**
     * Check if a message at TRACE level would actually be logged by this logger.
     * @return <code>true</true> if a message at TRACE level is actually logged
     */
    public boolean isTraceEnabled();

    /**
     * Log a message at TRACE level with passed list of params.<br/>
     * No logging happens if isTraceEnabled() returns <code>false</code>.
     * @param msg the string message (or a key in the message catalog)
     * @param params parameters to the message
     */
    public void trace(String msg, Object... params);
}
